package cn.exrick.xboot.modules.commonLink.serviceimpl;

import cn.exrick.xboot.modules.commonLink.dao.mapper.CommonLinkMapper;
import cn.exrick.xboot.modules.commonLink.entity.CommonLink;
import cn.exrick.xboot.modules.commonLink.service.ICommonLinkService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 常用链接接口实现
 * @author Exrick
 */
@Slf4j
@Service
@Transactional
public class ICommonLinkServiceImpl extends ServiceImpl<CommonLinkMapper, CommonLink> implements ICommonLinkService {

    @Autowired
    private CommonLinkMapper commonLinkMapper;

    /**
     * 20190724
     * njp
     * 新增常用链接分页的条件查询(使用map作为条件的载体)
     * map 为参数
     */
    public IPage<CommonLink> selectCommonLinkPageVoMap(Page page, @Param("map") Map<String,Object> map){
        return commonLinkMapper.selectCommonLinkPageVoMap(page,map);
    }

    /**
     * 获取num条的数据
     * @param map
     * @return
     */
    public List<CommonLink> selectCommonLinkByNum( @Param("map") Map<String,Object> map){
        return commonLinkMapper.selectCommonLinkByNum(map);
    }
}